package com.auto.base.service;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;


import com.auto.base.pojo.Post;

import com.auto.common.SessionInfo;
import com.base.callback.MapperCallBack;
import com.base.util.Page;
import com.base.model.interfaze.FieldAppendArray;

public interface PostService {

    /**
     * 单个数据查询
     * 
     * @param record
     * @param callback
     * @return
     */
    Post findPost(Post record, MapperCallBack callback) throws Exception;
    
    /**
     * 单个数据查询,字段并关联外键值
     * 
     * @param record
     * @param callback
     * @return
     */
    JSONObject findPostAndFkText(Post record, MapperCallBack callback, FieldAppendArray appendArray) throws Exception;
    
    /**
     * 根据模型查找信息
     * 
     * @param 模型
     * @return 对象
     * @throws Exception
     */
    public List<Post> listPost(Post record, String orderByClause, Page page, MapperCallBack callback) throws Exception;

    /**
     * 查询,字段并关联外键值
     * 
     * @param record
     * @param orderByClause
     * @param page
     * @param callback
     * @param appendArray
     * @return
     * @throws Exception
     */
    JSONArray listPostAndFkText(Post record, String orderByClause, Page page, MapperCallBack callback, FieldAppendArray appendArray) throws Exception;
	
	
    /**
     * 新增数据
     * 
     * @param record
     * @throws Exception
     */
    int insertPost(Post record) throws Exception;

    /**
     * 物理删除数据
     * 
     * @param record
     * @param callback
     * @throws Exception
     */
    void dropPost(String pks) throws Exception;

    /**
     * 更新数据
     * 
     * @param record
     * @throws Exception
     */
    void modifyPost(Post record, MapperCallBack callback) throws Exception;
    
    /**
     * 根据主键来更新 只更新有值的属性
     * @param record
     * @throws Exception
     */
    void modifyPostByPkSelective(Post record) throws Exception;
    
    /**
     * 根据主键来更新 更新所有值
     * @param record
     * @throws Exception
     */
    void modifyPostByPk(Post record) throws Exception;
    
    /**
     * 总条数
     * 
     * @param record
     * @param callback
     * @throws Exception
     */
    int countPost(Post record, MapperCallBack callback) throws Exception;

    /**
     * 总条数新增方法
     * 
     * @param record
     * @throws Exception
     */
    int countPost(Post record) throws Exception;
    
     /**
     * 逻辑删除数据最新方法
     * 杨浩
     * @param pks
     * @throws Exception
     */
    void deletePost(String pks) throws Exception;
    
     /**
    * 对导入进来的数据进行入库处理 
    * @param list
    * @throws Exception
    */
   void inputExcelData(Map<String,Object> result) throws Exception;
     /**
     * 
     * @param list
     * @param request
     * @throws Exception
     * 批量导入
     */
   void insertBeatch(List<Post> list,SessionInfo sessionInfo) throws Exception ;
    /**
    * 
    * @param list
    * @param request
    * @throws Exception
    * 批量修改
    */
   void modifyBeatch(List<Post> list,SessionInfo sessionInfo) throws Exception;
    

}
